#!/usr/bin/env python3

#            ---------------------------------------------------
#                           Arissploit Framework                                 
#            ---------------------------------------------------
#                Copyright (C) <2019-2020>  <Entynetproject>
#
#        This program is free software: you can redistribute it and/or modify
#        it under the terms of the GNU General Public License as published by
#        the Free Software Foundation, either version 3 of the License, or
#        any later version.
#
#        This program is distributed in the hope that it will be useful,
#        but WITHOUT ANY WARRANTY; without even the implied warranty of
#        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#        GNU General Public License for more details.
#
#        You should have received a copy of the GNU General Public License
#        along with this program.  If not, see <http://www.gnu.org/licenses/>.

import os

os.system("printf '\033]2;Arissploit Framework\a'")

# Import python modules
import traceback
import sys
import logging
import getopt
import csv

# Disable scapy warning
logging.getLogger("scapy.runtime").setLevel(logging.ERROR)

# Import getpath for lib path
from core import getpath

# Append lib path
sys.path.append(getpath.lib())

# Import core modules
from core import colors
from core import header
from core import shell
from core import scriptio
from core import getpath

# Print header
os.system("clear")
print(header.arissploit)
header.print_info()

# Exception handling

def fatalerror():
	print("["+colors.bold+colors.red+"err"+colors.end+"] Unexpected error:")
	traceback.print_exc()
	print(colors.end)
	main(0, None)

# Start up shell

try:
	def main():
		try:
			shell.run()

		except SystemExit as e:
			sys.exit(e)

		except:
			fatalerror()

	if __name__ == '__main__':
		main()

# Exceptions

except KeyboardInterrupt:
	print()

except SystemExit as e:
	sys.exit(e)

except:
	fatalerror()
